//
//  JZBAddCell.m
//  JZB
//
//  Created by liujianlong on 2022/8/31.
//

#import "JZBAddCell.h"

@implementation JZBAddCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setInputNumber:(BOOL)inputNumber{
  _inputNumber = inputNumber;
    self.input.keyboardType = inputNumber ? UIKeyboardTypeNumberPad : UIKeyboardTypeDefault;
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if (self.inputNumber && [textField.text containsString:@"."]) {
        return NO;
    }
    return  YES;
}
- (void)textFieldDidChangeSelection:(UITextField *)textField{
    if (self.inputBlock) {
        self.inputBlock(textField.text);
    }
}



@end
